<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>商圈管理</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/treetable.jsp" %>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnImport").click(function(){
				$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true}, 
					bottomText:"导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"});
			});
		});
	</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/sys/shangquan/import" method="post" enctype="multipart/form-data"
			class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入，请稍等...');"><br/>
			<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>　　
			<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "/>
			<a href="${ctx}/sys/area/import/template?typeName=002">下载模板</a>
		</form>
	</div>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/shangquan">商圈列表</a></li>
		<li><a href="${ctx}/sys/shangquan/form">商圈添加</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="area" action="${ctx}/sys/shangquan" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>商圈名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
				<input id="btnImport" class="btn btn-primary" type="button" value="导入"/>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="treeTable" class="table table-striped table-bordered table-condensed">
		<thead> <tr>
				<th>所属区域</th>
				<th>商圈名称</th>
				<th>商圈编号</th>
				<th>备注</th>
				<th>操作</th>
				</tr>
		</thead>
	<tbody>
		<c:forEach items="${list}" var="area">
			<tr>
				<td>
					${area.areaPname}
				</td>
				<td>
					${area.name}
				</td>
				<td>
					${area.code}
				</td>
				<td>
					${area.remarks}
				</td>
				<td>
					<a href="${ctx}/sys/shangquan/form?id=${area.id}">修改</a>
					<a href="${ctx}/sys/shangquan/delete?id=${area.id}" onclick="return confirmx('确认要删除该商圈吗？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
</body>
</html>